#include <iostream>
#include <cstring>

using namespace std;

#define maxn 10000000

int d[maxn];

int cal(long long k)
{
	if (k < maxn && d[k] != 0) return d[k];

	if (k % 2 == 0) return cal(k/2)+1;
	return cal(k*3+1)+1;
}

int main()
{
	//freopen("100.in", "r", stdin);

	memset(d, 0, sizeof(d));
	d[1] = 1;
	for (int i = 2; i <= 1000000; i++) d[i] = cal(i);

	int x, y;
	while (cin >> x)
	{
		cin >> y;
		int res = -1;

		cout << x << " " << y << " ";

		if (y < x)
		{
			int temp = x;
			x = y;
			y = temp;
		}

		for (int i = x; i <= y; i++) res = (res < d[i]) ? d[i] : res;
		cout << res << endl;
	}
	return 0;
}
